app.controller('RatingListCtrl', function ($scope, $rootScope) {

	$scope.queryMap = {};

	$scope.reload = $scope.page.loader('rating/{pageIndex}/{pageSize}/page');
	$scope.$on('pageIndex', function (event, p) { $scope.reload(p, $scope.queryMap); });
	$scope.query = function () { $scope.reload(1, $scope.queryMap); };


	(function () {
		$scope.auths = $rootScope.loginUser.auths;
		$scope.ms = [];
		for (var i = 0; i < $scope.auths.length; i++) {
			if ($scope.auths[i] == "AUTH_BOOKING_RATING") {
				$scope.ms.push(1);
			} else if ($scope.auths[i] == "AUTH_RENT_RATING") {
				$scope.ms.push(2);
			} else if ($scope.auths[i] == "AUTH_BUS_RATING") {
				$scope.ms.push(3);
			}
		}
		$scope.queryMap.module__ids = $scope.ms;
	})();
	$scope.reload(1, $scope.queryMap);
	
	
});
